﻿<%@ Page Language="C#" %>

<%@ Import Namespace="wojilu" %>
<%@ Import Namespace="wojilu.View" %>
<%@ Import Namespace="wojilu.Apps.Qycms.Domain" %>
<%@ Import Namespace="wojilu.Apps.Qycms.Service" %>

<%PowerGroup modelpowergroup = v.data("powergroup") as PowerGroup; %>
<%var bllPowerGroupService = new PowerGroupService(); %>

<%var updirtype = Convert.ToInt32(v.data("updirtype")); %>
<%if(updirtype ==1){ %>
<div class="infolist">
	<table border="0" style="border-collapse:collapse" width="100%" bordercolor="#FFFFFF" onclick="javascript:search('#{uploadurl}');">
			<tr>
				<td width="45%" id="left" class="padding-left3"><img src="#{path.img}ybb/images/fileicon/dir.png"> /#{dirlist}</td>
				<td width="10%"></td>
				<td width="20%"></td>
				<td width="25%" id="infotype">
					<table border="0" style="border-collapse:collapse" bordercolor="#FFFFFF">
						<tr>
							<td><a class="setedit3" id="center" href="#body" onclick="javascript:search('#{uploadurl}');" title="_{filemanage_view_updir}" hidefocus="true">_{filemanage_view_updir}</a></td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
</div>
<%} %>
<%var dt = v.data("dt") as System.Data.DataTable; %>
<%if(dt.Rows.Count>0){ %>
<%foreach(System.Data.DataRow row in dt.Rows){ %>
<div class="infolist">
    <%var bottype = String.Empty; %>
    <%if(row["type"].ToString() == "1"){ %>
    <%bottype = "dir"; %>
    <%}else{ %>
    <%bottype = Utils.GetFileExtName(row["name"].ToString()); %>
    <%} %>
    <%if (bottype == "dir") { %>
	<table border="0" style="border-collapse: collapse" width="100%" bordercolor="#FFFFFF" title="_{filemanage_view_opendir}" onclick="javascript:search('<%=link.to(new wojilu.Web.Controller.Admin.Qycms.TemplateController().TemplateList) + "?skindir=" + v.data("skindir").ToString() + "&filedir=" + v.data("filedir").ToString() + "&dirlist=" + v.data("dirlist").ToString() + row["name"] + "/" %>');">
	<%}else{ %>
	<table border="0"  style="border-collapse:collapse" width="100%" bordercolor="#FFFFFF">
	<%} %>
		<tr>
			<td width="45%" id="left" class="padding-left3"><img src="#{path.img}ybb/images/fileicon/<%=bottype %>.png"> <%=strUtil.Split(row["name"].ToString(),".")[0] %></td>
			<td width="10%"><%=bottype %></td>
			<td width="20%"><%=row["lastWriteTime"] %></td>
			<td width="25%" id="infotype">
                <%if (bottype != "dir" && (row["content_type"].ToString() == "aspx" || row["content_type"].ToString() == "html" || row["content_type"].ToString() == "xml" || row["content_type"].ToString() == "js" || row["content_type"].ToString() == "css" || row["content_type"].ToString() == "less"))
                  { %>
				<table border="0" style="border-collapse:collapse" bordercolor="#FFFFFF">
					<tr>
                        <%if (bllPowerGroupService.powercheck("templates", "templateedit", modelpowergroup))
                          { %>
						<td>
							<a class="setedit" onclick="javascript:parent.onbotton('_{templatemain_edit_title}','<%=link.to(new wojilu.Web.Controller.Admin.Qycms.TemplateController().TemplateEdit) %>?dir=<%=v.data("skindir") + "/" + v.data("dirlist") %>&filename=<%=row["name"] %>&type=edit&freshid='+Math.random()+'&iframename='+self.frameElement.getAttribute('name'),false,'tempfileedit<%=row["Id"] %>',self.frameElement.getAttribute('name'));" id="tempfileedit<%=row["Id"] %>" href="#body" title="_{templatemain_edit_title}" hidefocus="true">_{setedit_botton}</a>
						</td>
						<td class="padding-left3">
							<a class="setedit" onclick="javascript:parent.onbotton('_{templatemain_copy_title}','<%=link.to(new wojilu.Web.Controller.Admin.Qycms.TemplateController().TemplateCopy) %>?dir=<%=v.data("skindir") + "/" + v.data("dirlist") %>&filename=<%=row["name"] %>&freshid='+Math.random()+'&iframename='+self.frameElement.getAttribute('name'),false,'tempfilecopy<%=row["Id"] %>',self.frameElement.getAttribute('name'));" id="tempfilecopy<%=row["Id"] %>" href="#body" title="_{templatemain_copy_title}" hidefocus="true">_{setcopy_botton}</a>
						</td>
						<%} %>
                        <%if (bllPowerGroupService.powercheck("templates", "templatedel", modelpowergroup))
                          { %>
						<td class="padding-left3"><a class="setedit" onclick="javascript:submiturl('<%=link.to(new wojilu.Web.Controller.Admin.Qycms.TemplateController().TemplateDel) %>?dir=<%=v.data("skindir") + "/" + v.data("dirlist") %>&filename=<%=row["name"] %>&freshid='+Math.random(),'#{load}','_{run_ok}','_{run_no}',true,'_{templatemain_del_log_mess}','selectform','selectall','check_all');" href="#body" title="_{setdel_botton}" hidefocus="true">_{setdel_botton}</a></td>
						<%} %>
					</tr>
				</table>
				<%} %>
			</td>
		</tr>
	</table>
</div>
<%} %>
<%}else{ %>
<div class="infolist">
	<table border="0" style="border-collapse:collapse" width="100%" bordercolor="#FFFFFF">
		<tr>
			<td align="center">_{list_nothing_title}</td>
		</tr>
	</table>
</div>
<%} %>